﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GetTogether.Studio.Logging;

public partial class logging_Callback_Projects : ProjectCallbackTemplate<ProjectParameter>
{
    protected override void OnPreInit(EventArgs e)
    {
        ProjectUserControl = "~/Logging/Components/ProjectGroup.ascx";
        ProjectBasePath = ProjectParameter.GetSettingsPath(CurrentSession.UserCode);

        if (IsGetNewProject)
        {
            EditProject = ProjectParameter.GetSettingsByProjectName(CurrentSession.UserCode, ProjectName, CurrentSession.ShareUserCode);
        }
        else if (!string.IsNullOrEmpty(Content))
        {
            EditProject = new ProjectParameter();
            EditProject = GetTogether.Utility.SerializationHelper.FromXml<ProjectParameter>(Content);
            if (EditProject != null) ProjectName = EditProject.ProjectName;
        }
        base.OnPreInit(e);
    }
}